import Content from '@/sheep/layouts/content.vue';
import { request } from '@/sheep/request';
import { SELECT, CRUD } from '@/sheep/request/crud';

const route = {
  path: 'earning',
  name: 'shop.admin.earning',
  component: Content,
  meta: {
    title: '账户流水',
  },
  children: [
    {
      path: 'bill',
      name: 'shop.admin.earning.bill',
      component: () => import('./bill/index.vue'),
      meta: {
        title: '收入明细',
      },
    },
	{
		path: 'incomelog',
		name: 'shop.admin.earning.incomelog',
		component: () => import('./incomelog/index.vue'),
		meta: {
		  title: '供应商收入明细',
		},
	  },
    {
      path: 'wallet',
      name: 'shop.admin.earning.wallet',
      component: () => import('./wallet/index.vue'),
      meta: {
        title: '账户余额',
      },
    },
  ],
};

const api = {
  operations_list: (data) =>
    request({
      url: '/operations/admin/walletlog/list',
      method: 'GET',
      params:data,
    }),
  operations_orderList: (data) =>
    request({
      url: '/operations/admin/walletLog/orderList',
      method: 'GET',
      params:data,
    }),
	supplier_orderList: (data) =>
		request({
		  url: '/operations/admin/walletLog/supplierOrderList',
		  method: 'GET',
		  params:data,
		}),
  bill: {
    ...CRUD('/operations/admin/ai/question'),
    changeStatus: (id,data) =>
      request({
        url: `/operations/admin/ai/question/changeStatus/${id}`,
        method: 'POST',
        data,
      }),
  }, 
  wallet: {
    ...CRUD('/operations/admin/ai/question'),
    changeStatus: (id,data) =>
      request({
        url: `/operations/admin/ai/question/changeStatus/${id}`,
        method: 'POST',
        data,
      }),
  }
};

export { route, api };
